package com.codegeek.project.slope.service.impl;

import com.codegeek.project.slope.domain.SlopeSensorType;
import com.codegeek.project.slope.mapper.SlopeSensorTypeMapper;
import com.codegeek.project.slope.service.ISlopeSensorTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 传感器类型
 * Service业务层处理
 *
 * @author codegeek
 * @date 2020-02-20
 */
@Service
public class SlopeSensorTypeServiceImpl implements ISlopeSensorTypeService {
    @Autowired
    private SlopeSensorTypeMapper slopeSensorTypeMapper;

    /**
     * 查询传感器类型
     *
     * @param sensorTypeId 传感器类型
     *                     ID
     * @return 传感器类型
     */
    @Override
    public SlopeSensorType selectSlopeSensorTypeById(Integer sensorTypeId) {
        return slopeSensorTypeMapper.selectSlopeSensorTypeById(sensorTypeId);
    }

    /**
     * 查询传感器类型
     * 列表
     *
     * @param slopeSensorType 传感器类型
     * @return 传感器类型
     */
    @Override
    public List<SlopeSensorType> selectSlopeSensorTypeList(SlopeSensorType slopeSensorType) {
        return slopeSensorTypeMapper.selectSlopeSensorTypeList(slopeSensorType);
    }

    /**
     * 新增传感器类型
     *
     * @param slopeSensorType 传感器类型
     * @return 结果
     */
    @Override
    public int insertSlopeSensorType(SlopeSensorType slopeSensorType) {
        return slopeSensorTypeMapper.insertSlopeSensorType(slopeSensorType);
    }

    /**
     * 修改传感器类型
     *
     * @param slopeSensorType 传感器类型
     * @return 结果
     */
    @Override
    public int updateSlopeSensorType(SlopeSensorType slopeSensorType) {
        return slopeSensorTypeMapper.updateSlopeSensorType(slopeSensorType);
    }

    /**
     * 批量删除传感器类型
     *
     * @param sensorTypeIds 需要删除的传感器类型
     *                      ID
     * @return 结果
     */
    @Override
    public int deleteSlopeSensorTypeByIds(Long[] sensorTypeIds) {
        return slopeSensorTypeMapper.deleteSlopeSensorTypeByIds(sensorTypeIds);
    }

    /**
     * 删除传感器类型
     * 信息
     *
     * @param sensorTypeId 传感器类型
     *                     ID
     * @return 结果
     */
    @Override
    public int deleteSlopeSensorTypeById(Long sensorTypeId) {
        return slopeSensorTypeMapper.deleteSlopeSensorTypeById(sensorTypeId);
    }

    @Override
    public SlopeSensorType selectSlopeSensorTypeByName(String name) {
        return slopeSensorTypeMapper.selectSlopeSensorTypeByName(name);
    }
}
